package com.taysear.parcel.domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

@Entity
@Table(name="station_status")
public class StationStatus implements Serializable{
	private static final long serialVersionUID = 1763008813798139759L;

	@Id @GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long id;
	@NotNull 
	private String description;
	
	
	public Long getId() {
		return id;
	}
	
	public void setId(Long id) {
		this.id = id;
	}
	
	public String getDescription() {
		return description;
	}
	
	public void setDescription(String description) {
		this.description = description;
	}

	@Override
    public String toString() {
        return description;
    }
	
	@Override
    public boolean equals(Object obj) {
        if (obj instanceof StationStatus) {
            StationStatus o = (StationStatus) obj;
            if (this == o) {
                return true;
            }
            if (this.id == null || o.id == null) {
                return false;
            }
            return this.id.equals(o.id);
        }

        return super.equals(obj);
    }

    @Override
    public int hashCode() {
        return id == null ? 0 : id.hashCode();
    }
}
